<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link rel="stylesheet" href="css/bootstrap.min.css">
</head>
<body style="padding:100px">
    <!--表单存放信息，每个信息都用一个div存放-->
    <form>
        <div class="form-group">
            <label>用户名</label>
            <!--调用function f1来实施监控用户名-->
            <input type="username" class="form-control" placeholder="请输入用户名" style="width:10%" id="user" onchange="f1()">
        </div>
        <div class="form-group">
            <label>密码</label>
            <input type="password" class="form-control" placeholder="请输入密码" style="width:10%">
        </div>
        <div class="form-group">
            <label>性别</label>
            <br>
            <label class="radio-inline">
                <input type="radio" name="sex">男&nbsp; &nbsp;&nbsp; 
            </label>
            <label class="radio-inline">
                <input type="radio" name="sex">女  
            </label>
        </div>
        <div class="form-group">
            <label>学历</label>
            <br>
            <label class="radio-inline">
                <input type="radio" name="grade">本科
            </label>
            <label class="radio-inline">
                <input type="radio" name="grade">专科
            </label>
        </div>
        <div class="form-group">
            <label>自我介绍</label>
            <textarea class="form-control" cols="30" rows="5" style="width: 20%;"></textarea>
        </div>
        <div class="form-group">
            <button class="btn btn-primary">提交</button>
        </div>
    </form>
    <script src="js/jquery-3.6.0.min.js"></script>
    <script src="js/bootstrap.min.js"></script>
    <script>
        function f1() {
            var value = $("#user").val();
            if(value != "admin"){
                alert("用户名错误！");
            }
        }
        /* 给提交按钮设置一个点击事件*/
        $("button").click(function(){
            var message = $("textarea").val();
            alert(message);
            
        });
    </script>

</body>
</html>